<div class="popup_box" style="display:none; position:absolute; background:#FFFFFF;" id="set_inventory_cf1"> 
      <div class="popup_box_in" style="height:120px;">
	  <div style="float:left; width:90%; padding:5px;">
	      If you choose to re-list this item,please be aware that if any information has been<br />
	      changed by the ownere the product,since you originally picked up the product<br />
	      your re-list will reflect those changes.
	  </div>
	  <div style="float:left; width:98%; padding:5px;">
	      <input type="button" name="" value="Close" class="refer_btn" style="margin:0px; height:30px; cursor:pointer;" onclick="javascript:$('#set_inventory_cf1').hide();" />
			      &nbsp;&nbsp;&nbsp;&nbsp;
	      <input type="button" id="proceedbtn" value="Proceed" class="yellow_btn"  style="float:none; height:30px; cursor:pointer;"/>
	  </div>
      </div>
  </div>
<script>
function show_cf_box1(productId)
{
  
    var ntop = (( $(window).height() - $('#relist_cf_'+productId).height()) / 2+$(window).scrollTop()) - 100;
    var nleft = ( $(window).width() - $('#relist_cf_'+productId).width()) / 2+$(window).scrollLeft();

    $('#set_inventory_cf1').css({'left': '', 'top':ntop});
    $('#set_inventory_cf1').fadeIn('slow');
    $('#proceedbtn').click(
      function() {
	window.location="index.php?mySwapen&post_ownprod="+productId;
      }
    );
   // $('#proceedbtn').attr('onclick','window.location="index.php?mySwapen&post_ownprod='+productId+'";');
}
  
function show_more_info2()
{
  var ntop = ( $(window).height() - $('#more_info2').height() ) / 2+$(window).scrollTop();
  var nleft = ( $(window).width() - $('#more_info2').width() ) / 2+$(window).scrollLeft();

  $('#more_info2').css({'left': nleft, 'top':ntop});
  $('#more_info2').fadeIn('slow');
}



//function show_cus_swa_sto()
//{
//  var ntop = (( $(window).height() - $('#cus_u_swa').height()) / 2+$(window).scrollTop()) - 100;
//  var nleft = ( $(window).width() - $('#cus_u_swa').width()) / 2+$(window).scrollLeft();
//  $('#custom_u_swapen_store').css({'left': '', 'top':ntop});
//  $('#custom_u_swapen_store').fadeIn('slow');
//}
</script>

</script>

<script language="javascript" type="text/javascript">
function delWish(prid)
{
var conf=confirm("Are you sure you want to delete this item?");
if(conf){
funDelProduct('frmProListOwn','prod',prid)
}
}
</script>
<div style=" display: none; width: 400px; font-weight:bold; padding:10px; background-color:#cccccc; opacity:0.9;" class="user_popup" id="more_info2">
  <span style="float:left; width:100%; text-align:right; margin-bottom:5px;"><label style="cursor:pointer;" onclick="$('#more_info2').fadeOut('slow');">x</label></span>
  <span style="float:left; width:100%; margin-bottom:10px;" id="desc_info"><?php if($_SESSION['user_type_sess']==5) { ?>Your Inventory is your central place for creating, editing, and customizing products you wish to sell.<?php } else { ?>This Inventory is your central place for creating, editing, and customizing products you wish to sell. In this inventory you are selling products that you own and will ship out yourself.<?php } ?></span>
</div>
<?php
    if(isset($_REQUEST['post_ownprod']))
	{
	      $futureTime = mktime(0, 0, 0, date('m'), date('d')+30, date('Y'));
	      $d=date('Y-m-d h:i:s',$futureTime);
	     // $curtime=date("Y-m-d h:i:s");
	      $rs=mysql_query("update tbl_items set bargain_duration='$d' where item_id='".$_REQUEST['post_ownprod']."'");
	      ?>
	     <script language="javascript">
			      $(document).ready(function() {
				var ntop = (( $(window).height() - $('#relist_cf_<?php echo $_REQUEST['post_id']?>').height()) / 2+$(window).scrollTop()) - 100;
				var nleft = ( $(window).width() - $('#relist_cf_<?php echo $_REQUEST['post_id']?>').width()) / 2+$(window).scrollLeft();
			       //alert(ntop+' '+nleft);
				$('#del_inventory_cf1').css({'left': '', 'top':ntop});
				$('#del_inventory_cf1').fadeIn('slow');
			      });
			        // $("#del_inventory_cf1").show();
			      </script>
	      <?php
	}
?>
<div id='panel'>
<div class="fulldiv" style="width:700px;">

 <div class="fulldiv" style="margin:10px 0px 0px 0px;">
	
 	<div style="float:left; margin:0px 10px 0px 10px; padding-top:8px;">
	    <strong class="orangehead">
		  <?php
		  if($_SESSION['user_type_sess']==5)
		  {
			echo 'Your Inventory';
		  }
		  else  {
		  ?>Sell YOUR product/s
		  <?php } ?>
	    </strong>
	</div>
	<div class="greyarrowsml" onclick="show_hide_s_boxes('sell_u_p')" id="arrow_sell_u_p">&nbsp;</div>
	
	<div class="fulldiv" style="width:49%; margin-top:13px; float:right;">
	<div class="star" style="float: right;" id="star_sell_u_p">&nbsp;</div>
	<a href="javascript:void(0)" class="bluelink" style="float: right;" onclick="show_more_info2()" id="more_info_sell_u_p">more info</a>
	</div>

<div id="sell_u_p">
<div class="fullbox_top">&nbsp;</div>
	<div class="fullbox_repeat">
<table width="100%" border="0">
<?php if($_SESSION['user_type_sess']=="5") { 
//delete single product		 
			if(!empty($_POST['hidDelPro'])) {
				$proId=$_POST['hidDelPro'];
				$sqlDelPro2="Delete from tbl_wholeseller_product where product_id=$proId";
				$rstDelPro2=mysql_query($sqlDelPro2);
				if($rstDelPro2) {
				require_once 'includes/class.phpmailer.php'; 
				//setup for auto email
					$sqlEmail="select * from tbl_emails where email_type='Item Deleted'";
					$resEmail=mysql_query($sqlEmail);
					$rowEmail=mysql_fetch_array($resEmail);
					
					$sqlSellers="select * from tbl_items ti, tbl_users tu where tu.user_id=ti.seller_id and ti.product_id='".$proId."'";
					$resSellers=mysql_query($sqlSellers);
					while($rowSellers=mysql_fetch_array($resSellers))
					{
					$subj=str_replace('##_ItemName',$_POST['itemname'],$rowEmail['email_subject']);
					$emailContent=str_replace('##_MerchantName',$rowSellers['username'],$rowEmail['email_body']);
					$emailContent=str_replace('##_ItemName',$_POST['itemname'],$emailContent);
	  $mailmsg="<table width='100%' border='0' style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px; line-height:25px'>
  <tr>
    <td width='18%' height='41'><table width='100%' border='0'>
      <tr>
        <td width='19%' height='68'><img src='http://www.swapen.com/images/logo.gif'></td>
        <td width='81%'> </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height='32' colspan='2' style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;'>".$emailContent."</td>
  </tr>
  
 
</table>
";
		$mail = new PHPMailer(); // defaults to using php "mail()"
	  	$mail->MsgHTML($mailmsg);
		$mail->From       = "mail@swapen.com";
		$mail->FromName   = "Swapen.com";
		$mail->Subject    = $subj;
		$mail->AddAddress($rowSellers['email'], $firstName);
		$mail->Send();
					}
				echo "<div id='suc-msg' align='center' style='width:650px'> Your product deleted. </div><br>"; 
				}
				}
?>
  
  <tr>
    <td colspan="2">		
		 <form name="frmProListOwn" id="frmProListOwn" method="post" action="">
		 	<input type="hidden" name="hidDelPro" id="hidDelPro">
            <input type="hidden" name="hidDelProKey" id="hidDelProKey">
             <input type="hidden" name="hidEditSellingItemOwn" id="hidEditSellingItemOwn">
		 <?php		   
				   $sqlSelPro="SELECT * FROM tbl_wholeseller_product where posted_by='$userId' ORDER BY product_id DESC";
				   //echo "SELECT * FROM tbl_wholeseller_product where posted_by='$userId' ORDER BY product_id DESC";
				   $rstSelPro=mysql_query(getPagingQuery($sqlSelPro,$itemPerPage));				  
				   $num=mysql_num_rows($rstSelPro);
				   if($num==0)
					{
					?>
					  <table width='100%' border='0' align='center' cellspacing='0'>
						<tr>
						  <td colspan="15" align="center">
						    <div class="box" style="float:none;">
							<div class="box_top">&nbsp;</div>
							<div class="box_middle">
							    <div class="boxtxt_out">&nbsp;</div>
							    <div class="boxtxt_out"><em>Start selling your products Today!</em></div>
							    <div class="boxtxt_out">
							      <div class="box_img">
								      <img src="images/starthere_blue.png" style="cursor:pointer;" onclick="window.location='index.php?import=1'" />
							      </div>
							    </div>
							</div>
							<div class="box_bottom">&nbsp;</div>
						    </div>
						  </td>
						</tr>
					    </table>
					<?
					}
				   else {
					?>
					  <div style="float: left; width: 660px; border-bottom:2px solid #ccc;">
						<div style="width: 22px;" class="cell_head">&nbsp;</div>
						<div style="width: 22px;text-align:center;" class="cell_head">#</div>
						<div style="width: 140px; text-align:center;" class="cell_head">Product Name</div>
						<div style="width: 75px; text-align:center;" class="cell_head">Condition</div>
						<div style="width: 65px; text-align: center;" class="cell_head">Pick Up</div>
						<div style="width: 35px; text-align: center;" class="cell_head">Qty</div>
						<div style="width: 60px; text-align: center;" class="cell_head">Shipping</div>
						<div style="width: 70px; text-align: center;" class="cell_head">Price</div>
						<div style="width: 80px; text-align: center;" class="cell_head">&nbsp;</div>
					  </div>
				   		  
					<div style="max-height:165px; float:left; width:660px; overflow-y:auto;">	  	 
						 <?php
						 $r=1;
						 while($rowSelPro=mysql_fetch_array($rstSelPro))
					        {						   
						   $productId=$rowSelPro['product_id'];
						   $productcode=$rowSelPro['product_code'];
						   $productName=$rowSelPro['product_name'];
						   $productTitle = $rowSelPro['product_name'];					   
						   $productPrice=number_format($rowSelPro['product_price'],2);
						   $productQuantity=$rowSelPro['quantity'];
						   $productSellingType=$rowSelPro['selling_type'];
						   //echo $productSellingType;
						   $productShipping=$rowSelPro['shipping'];
						   $productProCondition=$rowSelPro['pro_condition'];
						   
						   $postedBy=$rowSelPro['posted_by'];
						   $postedDate=$rowSelPro['posted_date'];
						   
						   if(!empty($productShipping))
							    $productShipping=$productShipping;
						      else
							    $productShipping="-";
						      $pos=strstr($productShipping,"-");
						      if($pos===FALSE)
						      {
							    $productShipping="$".$productShipping;
						      }
						      
						      if($productSellingType=="")
						      {
							$productSellingType="-";
						      }
						      else if($productSellingType=="both" || $productSellingType=="local")
						      {
							 $productSellingType="Available";
						      }
						      else{
							    $productSellingType="Not available";
						      }
						      
						      if($productProCondition=="")
						       $productProCondition="-";
						    $imageExpand="<img src='./images/plus_ico.png' align='absmiddle' id='exp_$productId' style='cursor:pointer;' onclick='show_codes2($productId);' />";
						   ?>
						    <div id="divSellingPro<?php echo $productId?>" style="float:left; width:640px; border-bottom:1px solid #ccc; margin:3px 0px 3px;  background:#F9F7F7;">
							<div style="width: 22px;" class="cell_row"><?php echo $imageExpand;?></div>
							<div style="width: 22px; text-align:center;" class="cell_row"><?php echo $r;?></div>
							<div style="width: 140px; text-align:center;" class="cell_row"><a href='index.php?wholeproducts=<?php echo $productId;?>' title='$productTitle'><?php echo $productName;?></a></div>
							<div style="width: 75px; text-align:center;" class="cell_row"><?php echo $productProCondition;?></div>
							<div style="width: 70px; text-align: center;" class="cell_row"><?php echo $productSellingType;?></div>
							<div style="width: 35px; text-align: center;" class="cell_row"><?php echo $productQuantity;?></div>
						        <div style="width: 65px; text-align: center;" class="cell_row"><?php echo $productShipping;?></div>
							<div style="width: 70px; text-align: center;" class="cell_row">$<?php echo number_format(round($productPrice,2),2);?></div>
							
							
							<div style="width: 80px; text-align:center;" class="cell_row">
							  <a href='index.php?editwholeitem=<?php echo $productId;?>'>Edit</a> | <a href='javascript:void(0);' onClick="delWish('<?php echo $productId;?>')">Delete</a>
							</div>
						  </div>
	
					        	
						   <?php
						   			  
						 	$r++;
						 } ?>
						 
				</div>
						
           <?php
			 echo "<div style='float:left; width:660px;'><table width=100% border='0' align='center' cellspacing='0'><tr><td colspan='4'>
		    <a href='index.php?import=1' class='yellow_btn' style='float: left; height: 22px; margin: 10px 10px 0px 270px; 
		   padding: 7px 5px 0px; text-decoration: none;''>Add more Items</a>
		   </td></tr></table></div>";
	   
		} 
		   							
	?>
	</form>	</td>
</tr>
<?php } else {
//delete single product		 
			if(!empty($_POST['hidDelPro'])) {
			
				$proId=$_POST['hidDelPro'];
				$sqlDelPro3="Delete from tbl_product where product_id=$proId";
				$rstDelPro3=mysql_query($sqlDelPro3);
				if($rstDelPro3) { 
				//setup for auto email
					$sqlEmail="select * from tbl_emails where email_type='Item Deleted'";
					$resEmail=mysql_query($sqlEmail);
					$rowEmail=mysql_fetch_array($resEmail);
					
					$sqlSellers="select * from tbl_items ti, tbl_users tu where tu.user_id=ti.seller_id and ti.product_id='".$proId."'";
					$resSellers=mysql_query($sqlSellers);
					while($rowSellers=mysql_fetch_array($resSellers))
					{
					$subj=str_replace('##_ItemName',$_POST['itemname'],$rowEmail['email_subject']);
					$emailContent=str_replace('##_MerchantName',$rowSellers['username'],$rowEmail['email_body']);
					$emailContent=str_replace('##_ItemName',$_POST['itemname'],$emailContent);
	  $mailmsg="<table width='100%' border='0' style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px; line-height:25px'>
  <tr>
    <td width='18%' height='41'><table width='100%' border='0'>
      <tr>
        <td width='19%' height='68'><img src='http://www.swapen.com/images/logo.gif'></td>
        <td width='81%'> </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height='32' colspan='2' style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;'>".$emailContent."</td>
  </tr>
  
 
</table>
";
		$mail = new PHPMailer(); // defaults to using php "mail()"
	  	$mail->MsgHTML($mailmsg);
		$mail->From       = "mail@swapen.com";
		$mail->FromName   = "Swapen.com";
		$mail->Subject    = $subj;
		$mail->AddAddress($rowSellers['email'], $firstName);
		$mail->Send();
					}
				echo "<div id='suc-msg'> Your product deleted. </div><br>"; 
				}
				}
?>

  <tr>
    <td colspan="2">		
		 <form name="frmProListOwn" id="frmProListOwn" method="post" action="">
		 	<input type="hidden" name="hidDelPro" id="hidDelPro">
            <input type="hidden" name="hidDelProKey" id="hidDelProKey">
             <input type="hidden" name="hidEditSellingItemOwn" id="hidEditSellingItemOwn">
		 <?php		   
				   $sqlSelPro="SELECT p.*,i.bargain_duration,i.item_id FROM tbl_product p,tbl_items i where posted_by='$userId' and sell_by=1 AND p.product_id=i.product_id AND i.seller_id='$userId' AND i.owner_id='$userId' ORDER BY product_id DESC";
				   //echo $sqlSelPro;
				   //echo "SELECT p.*,i.bargain_duration,i.item_id FROM tbl_product p,tbl_items i where posted_by='$userId' and sell_by=1 AND p.product_id=i.product_id AND i.seller_id='$userId' AND i.owner_id='$userId' ORDER BY product_id DESC";
				   $rstSelPro=mysql_query(getPagingQuery($sqlSelPro,$itemPerPage));				  
				   $num=mysql_num_rows($rstSelPro);
				   if($num==0)
					{
					?>
					  <table width='100%' border='0' align='center' cellspacing='0'>
						<tr>
						  <td colspan="15" align="center">
						    <div class="box" style="float:none;">
							<div class="box_top">&nbsp;</div>
							<div class="box_middle">
							    <div class="boxtxt_out">&nbsp;</div>
							    <div class="boxtxt_out"><em>Do you have products you want sold for you?</em></div>
							    <div class="boxtxt_out">
							      <div class="box_img">
								      <img src="images/starthere_blue.png" style="cursor:pointer;" onclick="window.location='index.php?sell&by=own'" />
							      </div>
							    </div>
							</div>
							<div class="box_bottom">&nbsp;</div>
						    </div>
						  </td>
						</tr>
					    </table>
					<?php
					}
				   else {	?>
					  <div style="float: left; width: 660px; border-bottom:2px solid #ccc;">
						<div style="width: 22px;" class="cell_head">&nbsp;</div>
						<div style="width: 22px;" class="cell_head">#</div>
						<div style="width: 105px; text-align:center;" class="cell_head">Product Name</div>
						<div style="width: 75px; text-align:center;" class="cell_head">Condition</div>
						<div style="width: 65px; text-align: center;" class="cell_head">Pick Up</div>
						<div style="width: 35px; text-align: center;" class="cell_head">Qty</div>
						<div style="width: 60px; text-align: center;" class="cell_head">Shipping</div>
						<div style="width: 60px; text-align: center;" class="cell_head">Price</div>
						<div style="width: 105px; text-align: center;" class="cell_head">Time Left</div>
						<div style="width: 80px; text-align: center;" class="cell_head">&nbsp;</div>
					  </div>
				   	  
					  <div style="max-height:165px; float:left; width:660px; overflow-y:auto;">
						      
						<?php
						$r=1;
						while($rowSelPro=mysql_fetch_array($rstSelPro))
						{
						   
						      $productId=$rowSelPro['product_id'];
						      $productName=wordFormater($rowSelPro['product_name'],10);
						      $productTitle = $rowSelPro['product_name'];					   
						      $productPrice=$rowSelPro['product_price'];
						      $productThumb=$rowSelPro['product_thumbnail'];
						      $productImage=$rowSelPro['product_image'];
						      $productSellingType=$rowSelPro['selling_type'];
							  //echo $productSellingType;
						      $productShipping=$rowSelPro['shipping'];
							  //echo $productShipping;
						      $productProCondition=$rowSelPro['pro_condition'];
						      $productQuantity=$rowSelPro['quantity'];
						      $commission=$rowSelPro['commission'];
						      $postedBy=$rowSelPro['posted_by'];
						      $postedDate=$rowSelPro['posted_date'];
						      $bargainDate = $rowSelPro['bargain_duration'];
							  //echo $bargainDate;
						      $itemId=$rowSelPro['item_id'];
						      if(!empty($productShipping))
							    $productShipping=$productShipping;
						      else
							    $productShipping=" Free";
						      $pos=strstr($productShipping,"Free");
						      if($pos===FALSE)
						      {
							    $productShipping="$".$productShipping;
						      }
						      
//						      if($productSellingType=="both" || $productSellingType=="local")
//						      {
//							 $productSellingType="Available";
//						      }
//						      else{
//							    $productSellingType="Not available";
//						      }

						      if($productShipping=="Free" && $productSellingType=="local")
						      {
							     $productSellingType="Available";
						      }
						      else //if($productShipping=="Free" || $productShipping!="Free")
							  {
							     $productSellingType="Not available";
						      }
						      
						     
						       $timeLeft = getRemainingTime($bargainDate);
						      if($timeLeft < 0) {
							    $timeLeft ='&nbsp;<a href="javascript:void(0);" id="relist_cf_'.$itemId.'" class="yellow_btn" style="text-decoration:none; float:left; padding:5px 5px 5px 5px; height:15px; margin:10px 0 0 30px;" onclick="show_cf_box1('.$itemId.')">Re-List</a>';					    }
						 
							    $imageExpand="<img src='./images/plus_ico.png' align='absmiddle' id='exp_$productId' style='cursor:pointer;' onclick='show_codes1($productId);' />";
						      ?>
						      <div id="divSellingPro<?php echo $productId?>" style="float:left; width:659px; border-bottom:1px solid #ccc; margin:3px 0px 3px;  background:#F9F7F7;">
							    <div style="width: 22px;" class="cell_row"><?php echo $imageExpand;?></div>
							    <div style="width: 22px; text-align:center;" class="cell_row"><?php echo $r;?></div>
							    <div style="width: 110px; text-align:center;" class="cell_row"><a href="index.php?SellProduct=<?php echo $productId;?>" title="<?php echo $productTitle;?>"><?php echo $productName; ?></a></div>
							    <div style="width: 75px; text-align:center;" class="cell_row"><?php echo $productProCondition;?></div>
							    <div style="width: 70px; text-align: center;" class="cell_row"><?php echo $productSellingType;?></div>
							   
							    <div style="width: 35px; text-align: center;" class="cell_row"><?php echo $productQuantity;?></div>
							    
							    <div style="width: 65px; text-align: center;" class="cell_row"><?php echo $productShipping;?></div>
							    <div style="width: 60px; text-align: center;" class="cell_row">$<?php echo number_format(round($productPrice,2),2);?></div>
							    <div style="width: 110px; text-align: center;" class="cell_row" align="center"><?php echo $timeLeft;?></div>
							    <div style="width: 42px; text-align:center;" class="cell_row">
							      <a href="index.php?editlist=<?php echo $productId;?>" id="edit_cf_<?php echo $productId;?>">Edit</a>  <a href='javascript:void(0);' onClick="funDelProduct('frmProListOwn','prod',<?php echo $productId;?>)">Delete</a>
							    </div>
						      </div>
						      <?php
						  	$r++;
						} ?>
					  </div>	
          <?php
//		   echo "<div style='float:left; width:660px;'><table width=100% border='0' align='center' cellspacing='0'><tr><td colspan='4'>
//		    <a href='index.php?sell&by=own' class='yellow_btn' style='float: left; height: 22px; margin: 10px 10px 0px 180px; 
//		   padding: 7px 5px 0px; text-decoration: none;''>Add more Items</a>
//		   <a href='seller_store.php?sid=$userId' class='sbmt_btn' style='float: left; height: 22px; margin: 10px 10px 0px 20px; 
//		   padding: 7px 5px 0px; text-decoration: none;'>Customize Your Swapen Store</a>
//		   </td></tr></table></div>";
 
		   echo "<div style='float:left; width:660px;'><table width=100% border='0' align='center' cellspacing='0'><tr><td colspan='4'>
		    <a href='index.php?sell&by=own&flag=syp' class='yellow_btn' style='float: left; height: 22px; margin: 10px 10px 0px 180px; 
		   padding: 7px 5px 0px; text-decoration: none;''>Add more Items</a>
		   <a href='javascript:void(0)' onclick='show_cus_swa_sto()' class='sbmt_btn' style='float: left; height: 22px; margin: 10px 10px 0px 20px; 
		   padding: 7px 5px 0px; text-decoration: none;'>Customize Your Swapen Store</a>
		   </td></tr></table></div>";
						} 
									
	?>
	</form>	</td>
</tr>
<?php }?>
<tr>
      <td colspan="2"><div align="center" style='float:left; width:660px;'><?php   $link="mySwapen";	   echo $disp=getPagingLink($sqlSelPro,$itemPerPage,$link); ?></div>	</td>
</tr>
</table>
</div>
<div class="fullbox_bot">&nbsp;</div>
</div><br /><br /><br />
<hr style="float:left; width:500px; display:none;" id="hr_line_sell_u_p" />
</div>

</div>
<br />
<!--<div class="popup_box" style="display:none; position:absolute; background:#FFFFFF;" id="custom_u_swapen_store"> 
  <div class="popup_box_in" style="height:120px;">
      <div style="float:left; width:95%; padding:5px;">
	<span style="float:right; cursor:pointer;" onclick="$('#custom_u_swapen_store').hide();">x</span>
      </div>
      <div style="float: left; margin: 0 30px; padding: 5px; text-align: center; width: 85%;">
	<h3>Please make your selection</h3>
      </div>
      <div style="float:left; width:98%; padding:5px;">
	  
			  &nbsp;&nbsp;&nbsp;&nbsp;
	  <?php
	  $sqlChkStore = mysql_query("SELECT seller_store_id FROM tbl_seller_store WHERE seller_id='$userId'") or die(mysql_error());
	  $c_sqlChkStore =  mysql_num_rows($sqlChkStore);
	  if($c_sqlChkStore > 0)
	  {
	    $rowSelStore = mysql_fetch_array($sqlChkStore);
	    $storeId = $rowSelStore['seller_store_id'];
	  ?>
	    <input type="button" id="proceedbtn" onclick="window.location='index.php?updstore=<?php echo $storeId;?>'" value="Edit Store" class="yellow_btn"  style="float:none; height:30px; cursor:pointer;" />
	     <input type="button" id="proceedbtn" value="Go to Store" class="yellow_btn" onclick="window.location='seller_store.php?sid=<?php echo $userId;?>'"  style="float:none; height:30px; cursor:pointer;" />
	  <?php
	  }
	  else
	  {
	  ?>
	    <input type="button" id="proceedbtn" onclick="window.location='index.php?updstore=<?php echo $storeId;?>'" value="Add Store" class="yellow_btn"  style="float:none; height:30px; cursor:pointer;" />
	  <?php } ?>
      </div>
  </div>
</div>
-->
</div>
<div class="popup_box" style="display:none; position:absolute; background:#FFFFFF;" id="code_box">
  
  <div class="popup_box_in" style="">
    <table></table>
  </div>
</div>
<script>
function show_codes1(productId)
{
  $('#exp_'+productId).attr('src','./images/minus_ico.png');
  var url = "<?php echo $base_url;?>update_item_code.php";
  $.post(url,
  { 'product_id':productId,'action':'1'},
  function(data)
  {		
    if(trim1(data)!='fail')
    {
      var pos = $('#exp_'+productId).position();
      var top = pos.top;
      var left = pos.left;
      $('#code_box').css({'left': left, 'top':top}).html(data).show();
      
    }
    else
    {
     
      alert('No item codes avialable.');
      $('#exp_'+productId).attr('src','./images/plus_ico.png');
      $('#code_box').hide();
    }
  },
  'html');  
}

function show_codes2(productId)
{
  //alert("hi");
  $('#exp_'+productId).attr('src','./images/minus_ico.png');
  var url = "<?php echo $base_url;?>update_item_code1.php";
  $.post(url,
  { 'product_id':productId,'action':'1'},
  function(data)
  {		
    if(trim1(data)!='fail')
    {
      var pos = $('#exp_'+productId).position();
      var top = pos.top;
      var left = pos.left;
      $('#code_box').css({'left': left, 'top':top}).html(data).show();
      
    }
    else
    {
     
      alert('No item codes avialable.');
      $('#exp_'+productId).attr('src','./images/plus_ico.png');
      $('#code_box').hide();
    }
  },
  'html');  
}

function update_code(code_id)
{
  var code = $('#code_'+code_id).val();
  if(code.length>10)
  {
    alert('The product code can be atmost 10 characters long');
  }
  else
  {
    var url = "<?php echo $base_url;?>update_item_code.php";
    $.post(url,
    { 'code':code,'code_id':code_id,'action':'2'},
    function(data)
    {
	
      if(trim1(data)!='fail')
      {
	alert('Code changed successfully!');
      }
      else
      {
	alert('This code cannot be changed'); 
      }
    },
    'html');
  }
}

function update_code1(code_id)
{
  var code = $('#code_'+code_id).val();
  if(code.length>10)
  {
    alert('The product_code can be atmost 10 characters long');
  }
  else
  {
    var url = "<?php echo $base_url;?>update_item_code1.php";
    $.post(url,
    { 'code':code,'code_id':code_id,'action':'2'},
    function(data)
    {
	//alert(data);
      if(trim1(data)!='fail')
      {
	alert('Code changed successfully!');
      }
      else
      {
	alert('This code cannot be changed'); 
      }
    },
    'html');
  }
}

function trim1(stringToTrim) {
  return stringToTrim.replace(/^\s+|\s+$/g,"");
}      
</script>